# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-camera
pkgver=1.4.16.20230919
_commit=e62a495aa3b734eda586e4e9baf0cbcdb99fdae9
pkgrel=1
pkgdesc='Tool to view camera, take photo and video'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-camera"
license=('GPL3')
depends=('dtkcore' 'dtkgui' 'dtkwidget' 'qt5-base' 'qt5-svg' 'glib2' 'glibc' 'gcc-libs'
         'deepin-image-editor' 'ffmpeg' 'ffmpegthumbnailer' 'libpciaccess' 'portaudio' 'pulseaudio'
         'qt5-multimedia' 'dwayland' 'hicolor-icon-theme')
makedepends=('cmake' 'deepin-gettext-tools' 'ninja' 'qt5-tools')
optdepends=('deepin-image-viewer: view camera photos'
            'deepin-movie: view camera records'
            'deepin-file-manager: open with other applications')
groups=('deepin-extra')
source=("https://github.com/linuxdeepin/deepin-camera/archive/$_commit/$pkgname-$_commit.tar.gz")
sha512sums=('2e3ccaabc3150314ac566d601676a5bbdb50207764f70256f28f60e317b9dd80176951e388695ff004b937b60da39ea14aba4a941ded0b5ef3967e9bbab7f492')

build() {
  cd deepin-camera-$_commit
  cmake -GNinja . \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DVERSION=$pkgver
  ninja
}

package() {
  cd deepin-camera-$_commit
  DESTDIR="$pkgdir" ninja install
}
